import { useState, useEffect,useContext ,createContext,useRef, useMemo} from "react";
import ReactDOM from "react-dom/client";
function TextInputWithFocusButton() {
    const inputEl = useRef(null);
    const onButtonClick = () => {
      // `current` points to the mounted text input element
      
      (inputEl!.current! as HTMLInputElement).focus();
    };
    return (
      <>
        <input ref={inputEl} type="text" />
        <button onClick={onButtonClick}>Focus the input</button>
      </>
    );
  }

  export default TextInputWithFocusButton;